package com.bc.bcsellerapihttp.controller;

import com.bc.bcapi.service.RechargeService;
import com.bc.bcmodel.req.TxMessage;
import com.bc.commoncore.security.AES;
import com.bc.commoncore.util.JsonUtil;
import com.bc.commonentity.common.JsonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name EosController
 * @Description TODO
 * @Author douhaichao
 * @Date 2019/4/19 10:00
 * @Version 1.0
 **/
@Api("EOS相关")
@RestController
@RequestMapping("eos")
public class EosController {

    @Autowired
    RechargeService rechargeService;

    @RequestMapping(value = "recordeos", method = RequestMethod.POST)
    public JsonResult recordEos(String value) {
        String str = AES.aesDecrypt(value);
        TxMessage txMessage = JsonUtil.str2obj(str, TxMessage.class);
        rechargeService.recordEos(txMessage);
        return new JsonResult();
    }
}
